package edu.gdkm.demo10;

public class ShuYaZiThread2 implements Runnable{
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ShuYaZiThread2() {
    }

    public ShuYaZiThread2(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        for(int i=0;i<=10;i++){
            System.out.println(this.getName()+"：第"+i+"只鸭子");
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
